const $canSector = $(".can_sector");
const $can = $(".can");
const len = $canSector.length;
const min = $(".digits").attr("min");
const max = $(".digits").attr("max");
const degree = 360 / len;
$canSector.each(function (i) {
  $(this).css({
    transform: `translate(-50%) rotateX(${degree * i}deg)`,
  });
});
// 点击事件
$(".option").click(function () {
  if ($(".option input").is(":checked")) {
    $can.css({
      transform: "rotate(-90deg)",
    });
  } else {
    $can.css({
      transform: "rotate(0deg)",
    });
  }
});
$(".digits").change(function () {
  var value = $(this).val();
  // console.log(value)
  if (value > max) {
    value = max;
  } else if (value < min) {
    value = min;
  }
  $canSector.html(value);
});
